package com.zhang.service.impl;

import com.zhang.dao.BookingDao;
import com.zhang.dao.impl.BookingDaoImpl;
import com.zhang.pojo.Booking;
import com.zhang.service.BookingService;

import java.util.List;

public class BookingServiceImpl implements BookingService {
    BookingDao bookingDao = new BookingDaoImpl();
    @Override
    public List<Booking> selectBooking() {
        return bookingDao.selectBooking();
    }

    @Override
    public List<Booking> selectBookingGetCardId(String cardId) {
        return bookingDao.selectBookingGetCardId(cardId);
    }

    @Override
    public int insertBooking(Booking booking) {

        return bookingDao.insertBooking(booking);
    }

    @Override
    public int updateBooking(int id) {
        return bookingDao.updateBooking(id);
    }

    @Override
    public boolean count(String cordId) {
        int count = bookingDao.count(cordId);
        if (count > 0) {
            return true;
        } else {
            return false;
        }
    }
}
